<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        width: 100px;
        height: 100px;
        background-color: #f00;
        transition: all 0.5s;
      }
      .active {
        width: 500px;
        height: 500px;
        background-color: #0f0;
      }
    </style>
  </head>
  <body>
    <!-- 
        v-bind用于class多个值处理
        语法：
           :class="{class类名:boolean,class类名2:boolean2...}"
               true:使用该class类
               false:不使用该class
     -->
    <div id="app">
      <button @click="bol=!bol">点击后控制box大小</button>
      <div :class="{active:bol,box:true}"></div>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: '#app',
        data: {
          bol: false
        }
      })
    </script>
  </body>
</html>
